package com.lagou.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lagou.mapper.UserMapper;
import com.lagou.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    /**
     * 登录
     * @param name
     * @param password
     * @return
     */
    public User login(String name, String password){
        User user = userMapper.selectOne(new QueryWrapper<User>().lambda().eq(User::getName, name).eq(User::getPassword, password));
        return user;
    };


}
